import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: () => import('@/views/Index.vue'),
    meta: {
      title: '未来媒体实验室'
    }
  },
  {
    path: '/news',
    name: 'News',
    component: () => import('@/views/News.vue'),
    meta: {
      title: '新闻动态'
    }
  },
  {
    path: '/joinUs/teacher',
    name: 'JoinUs',
    component: () => import('@/views/JoinUs.vue'),
    meta: {
      title: '欢迎优秀的你加盟未来媒体实验室'
    }
  },
  {
    path: '/teams',
    name: 'Teams',
    component: () => import('@/views/Teams.vue'),
    meta: {
      title: '实验室团队'
    }
  },
  {
    path: '/article',
    name: 'Ariticle',
    component: () => import('@/views/Article.vue'),
    meta: {
      title: '新闻动态'
    }
  },
  {
    path: '/projects',
    name: 'Projects',
    component: () => import('@/views/Project.vue'),
    meta: {
      title: '项目介绍'
    }
  },
  {
    path: '/joinUs',
    name: 'JoinUs',
    component: () => import('@/views/JoinUs.vue'),
    meta: {
      title: '加入我们'
    }
  },
  {
    path: '/post',
    name: 'Test',
    component: () => import('@/views/Test.vue'),
    meta: {
      title: '生活视窗'
    }
  },
  {
    path:'/publicPost',
    name:'PublicPost',
    component:() => import ('@/views/PublicPost.vue'),
    mate:{
      title:'发布帖子'
    }

  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue'),
    meta: {
      title: '登录'
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/Register.vue'),
    meta: {
      title: '注册'
    }
  },
  {
   path: '/personal', 
   name: 'Personal',
   component: () => import('@/views/Personal.vue'),
  },
  {
    path: '/learning',
    name: 'Learning',
    component: () => import('@/views/Learning.vue'),
    meta: {
      title: '学习管理'
    }
  },
  {
    path: '/course/:id',
    name: 'CourseDetail',
    component: () => import('@/views/CourseDetail.vue'),
    meta: {
      title: '课程详情'
    }
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
